package cn.airia.as3wplib.service.impl
{
	import cn.airia.as3wplib.cfg.Configuration;
	import cn.airia.as3wplib.rpc.BaseServiceDelegate;
	import cn.airia.as3wplib.rpc.DelegateFactory;
	import cn.airia.as3wplib.service.IExtensionService;
	
	public class ExtensionServiceImpl implements IExtensionService
	{
		private var xmlrpc_url:String = Configuration.getInstance().xmlrpcUrl;
		private var extensionXmlrpc:BaseServiceDelegate;
		
		public function ExtensionServiceImpl()
		{
			extensionXmlrpc = DelegateFactory.getDelegate(DelegateFactory.TYPE_XMLRPC,xmlrpc_url);
		}

		public function getPostsByCatagory(blog_id:int,username:String,password:String,category_id:int,offset:int,num_posts:int,retFun:Function):void
		{
			var params:Array = new Array(blog_id,username,password,category_id,offset,num_posts);
			extensionXmlrpc.invoke("ext.getPostsByCatagory",params,retFun);
		}
	}
}